home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / CTBUtilities.p < prev    next >
Text File  |  1996-05-01  |  5KB  |  201 lines

  1. {
  2.      File:        CTBUtilities.p
  3.  
  4.      Contains:    Communications Toolbox Utilities interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT CTBUtilities;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CTBUTILITIES__}
  28. {$SETC __CTBUTILITIES__ := 1}
  29.  
  30. {$I+}
  31. {$SETC CTBUtilitiesIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MEMORY__}
  35. {$I Memory.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __DIALOGS__}
  38. {$I Dialogs.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __APPLETALK__}
  41. {$I AppleTalk.p}
  42. {$ENDC}
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47.  
  48. {$IFC FOR_SYSTEM7_ONLY }
  49.  
  50. CONST
  51.                                                                 {     version of Comm Toolbox Utilities     }
  52.     curCTBUVersion                = 2;                            {     Error codes/types     }
  53.     ctbuGenericError            = -1;
  54.     ctbuNoErr                    = 0;
  55.  
  56.  
  57. TYPE
  58.     CTBUErr                                = OSErr;
  59.  
  60. CONST
  61.     chooseDisaster                = -2;
  62.     chooseFailed                = -1;
  63.     chooseAborted                = 0;
  64.     chooseOKMinor                = 1;
  65.     chooseOKMajor                = 2;
  66.     chooseCancel                = 3;
  67.  
  68.  
  69. TYPE
  70.     ChooseReturnCode                    = INTEGER;
  71.  
  72. CONST
  73.     nlOk                        = 0;
  74.     nlCancel                    = 1;
  75.     nlEject                        = 2;
  76.  
  77.  
  78. TYPE
  79.     NuLookupReturnCode                    = INTEGER;
  80.  
  81. CONST
  82.     nameInclude                    = 1;
  83.     nameDisable                    = 2;
  84.     nameReject                    = 3;
  85.  
  86.  
  87. TYPE
  88.     NameFilterReturnCode                = INTEGER;
  89.  
  90. CONST
  91.     zoneInclude                    = 1;
  92.     zoneDisable                    = 2;
  93.     zoneReject                    = 3;
  94.  
  95.  
  96. TYPE
  97.     ZoneFilterReturnCode                = INTEGER;
  98.  
  99. CONST
  100.                                                                 {     Values for hookProc items         }
  101.     hookOK                        = 1;
  102.     hookCancel                    = 2;
  103.     hookOutline                    = 3;
  104.     hookTitle                    = 4;
  105.     hookItemList                = 5;
  106.     hookZoneTitle                = 6;
  107.     hookZoneList                = 7;
  108.     hookLine                    = 8;
  109.     hookVersion                    = 9;
  110.     hookReserved1                = 10;
  111.     hookReserved2                = 11;
  112.     hookReserved3                = 12;
  113.     hookReserved4                = 13;                            {     "virtual" hookProc items     }
  114.     hookNull                    = 100;
  115.     hookItemRefresh                = 101;
  116.     hookZoneRefresh                = 102;
  117.     hookEject                    = 103;
  118.     hookPreflight                = 104;
  119.     hookPostflight                = 105;
  120.     hookKeyBase                    = 1000;
  121.  
  122. {     NuLookup structures/constants     }
  123.  
  124. TYPE
  125.     NLTypeEntryPtr = ^NLTypeEntry;
  126.     NLTypeEntry = RECORD
  127.         hIcon:                    Handle;
  128.         typeStr:                Str32;
  129.     END;
  130.  
  131.     NLType                                = ARRAY [0..3] OF NLTypeEntry;
  132.     NBPReplyPtr = ^NBPReply;
  133.     NBPReply = RECORD
  134.         theEntity:                EntityName;
  135.         theAddr:                AddrBlock;
  136.     END;
  137.  
  138.     DialogHookProcPtr = ProcPtr;  { FUNCTION DialogHook(item: INTEGER; theDialog: DialogPtr): INTEGER; }
  139.  
  140.     NameFilterProcPtr = ProcPtr;  { FUNCTION NameFilter(VAR theEntity: EntityName): INTEGER; }
  141.  
  142.     ZoneFilterProcPtr = ProcPtr;  { FUNCTION ZoneFilter(theZone: Str32): INTEGER; }
  143.  
  144.     DialogHookUPP = UniversalProcPtr;
  145.     NameFilterUPP = UniversalProcPtr;
  146.     ZoneFilterUPP = UniversalProcPtr;
  147.  
  148. CONST
  149.     uppDialogHookProcInfo = $000003A0;
  150.     uppNameFilterProcInfo = $000000E0;
  151.     uppZoneFilterProcInfo = $000000E0;
  152.  
  153. FUNCTION NewDialogHookProc(userRoutine: DialogHookProcPtr): DialogHookUPP;
  154.     {$IFC NOT GENERATINGCFM }
  155.     INLINE $2E9F;
  156.     {$ENDC}
  157.  
  158. FUNCTION NewNameFilterProc(userRoutine: NameFilterProcPtr): NameFilterUPP;
  159.     {$IFC NOT GENERATINGCFM }
  160.     INLINE $2E9F;
  161.     {$ENDC}
  162.  
  163. FUNCTION NewZoneFilterProc(userRoutine: ZoneFilterProcPtr): ZoneFilterUPP;
  164.     {$IFC NOT GENERATINGCFM }
  165.     INLINE $2E9F;
  166.     {$ENDC}
  167.  
  168. FUNCTION CallDialogHookProc(item: INTEGER; theDialog: DialogPtr; userRoutine: DialogHookUPP): INTEGER;
  169.     {$IFC NOT GENERATINGCFM}
  170.     INLINE $205F, $4E90;
  171.     {$ENDC}
  172.  
  173. FUNCTION CallNameFilterProc(VAR theEntity: EntityName; userRoutine: NameFilterUPP): INTEGER;
  174.     {$IFC NOT GENERATINGCFM}
  175.     INLINE $205F, $4E90;
  176.     {$ENDC}
  177.  
  178. FUNCTION CallZoneFilterProc(theZone: Str32; userRoutine: ZoneFilterUPP): INTEGER;
  179.     {$IFC NOT GENERATINGCFM}
  180.     INLINE $205F, $4E90;
  181.     {$ENDC}
  182. FUNCTION InitCTBUtilities: CTBUErr;
  183. FUNCTION CTBGetCTBVersion: INTEGER;
  184. FUNCTION StandardNBP(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  185. FUNCTION CustomNBP(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  186. {$IFC OLDROUTINENAMES }
  187. FUNCTION NuLookup(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  188. FUNCTION NuPLookup(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  189. {$ENDC}
  190. {$ENDC}
  191. {$ALIGN RESET}
  192. {$POP}
  193.  
  194. {$SETC UsingIncludes := CTBUtilitiesIncludes}
  195.  
  196. {$ENDC} {__CTBUTILITIES__}
  197.  
  198. {$IFC NOT UsingIncludes}
  199.  END.
  200. {$ENDC}
  201.